package org.example.leetCode;

import java.util.HashSet;
import java.util.Set;

public class containsDuplicate {
    public boolean containsDuplicates(int[] nums) {
        Set set = new HashSet();
        for (int i =0;i< nums.length;i++){
            if (!set.add(nums[i])){
                return true;
            }
        }
        return false;
    }
}
